<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_model extends CI_Model {

	public function __construct()
	{
		parent::__construct();
		$this->load->database();
	}

	//get all users
	public function get_all()
	{

	}


	//get user with condition
	public function get_user_by($usname, $pass) {
		//create query
		$query = $this->db->query("select * from users where us_name='" . $usname . "'  and us_pass='" . do_hash($pass, 'md5') . "'");

		return $query->result();
	}

	//insert
	public function add_new() {

	}

	//edit
	public function save() {

	}

	//delete
	public function delete() {

	}

}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */